package com.yuhanginfo.modules.sys.entity;

import org.hibernate.validator.constraints.Length;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

import javax.validation.constraints.NotNull;

import com.yuhanginfo.common.persistence.DataEntity;
import com.yuhanginfo.common.utils.StringUtils;
import com.yuhanginfo.common.utils.excel.annotation.ExcelField;

/**
 * 平台商品信息管理Entity
 * @author yinhao
 * @version 2017-09-11
 */
public class Goods extends DataEntity<Goods> {
	
	private static final long serialVersionUID = 1L;
	

	
	private String code;		// 商品号
	private String cnName;		// 商品名称
	private String enName;		// 商品英文名
	private String storeCode;		// 所属门店号
	private Integer goodstypeId;		// 商品类型
	private Integer venderId;		// 厂家号
	private Double minPrice;		// 保底价格
	private Double price;		// 价格
	private Double memberPrice;		// 会员价
	private Integer classesId;		// 类目id
	private String image;		// 商品图片，多个图片用分号分隔
	private Integer status;		// 上架状态：0下架，1上架
	private String remark;		// 默认物料描述，可修改
	private String source;		// 商品来源:平台，门店，所有
	private String detail;		// 商品详情
	private String service;		// 售后服务
	private String examineStatus;		// 审核状态:0未通过，1已通过
	private String examineInfo;		// 审核原因
	private Date upDate;
	private String videoUrl;
	private String venderCode;
	private String goodsIntroduce;//商品介绍(富文本内容)
	private String materielCode;
	private String materielCnName;
	private String partsCode;
	private String venderName;
	private String storeCnName;
	private Integer storeGoodsStock;
	private Integer storeGoodsSellNum;
	private Date storeGoodsUpdateDate;
	private Integer queryStatus;
	private String queryPartsCode;
	private String queryMaterielCode;
	private String queryCnName;
	private String queryVenderName;
	private Date starUpDate;
	private Date endUpDate;
	private Integer queryExamineStatus;
	private Integer querySource;
	private String queryStoreCode;
	private Integer queryVenderId;
	
	private Integer classessOnceId;//一级类目id
	private Integer classessTwiceId;//二级类目id
	private Integer classessThirdId;//三级类目id
	private Integer goodsNum;
	private BigDecimal totalMoney;
	private String failReason;
	
	private String deleteImage;
	private String deleteDetail;
	private String deleteService;
	private String partCode;
	private List<String> carList;
	
	/**
	 * 商店类型（1自营，2第三方）
	 */
	private String storeType;

	/**
	 * 商品编号
	 */
	private String goodsCode;
	/**
	 * 店名
	 */
	private String storeName;
	/**
	 * 库存数量
	 */
	private Integer storeStock;
	/**
	 * 会员价格
	 */
	private BigDecimal vipPrice;
	/**
	 * 门店区域
	 */
	private String areaName;
	
	
	
	public Goods() {
		super();
	}

	public Goods(String id){
		super(id);
	}
	public String getVenderCode() {
		return venderCode;
	}

	public void setVenderCode(String venderCode) {
		this.venderCode = venderCode;
	}
	public String getFailReason() {
		return failReason;
	}

	public void setFailReason(String failReason) {
		this.failReason = failReason;
	}

	public BigDecimal getTotalMoney() {
		return totalMoney;
	}

	public void setTotalMoney(BigDecimal totalMoney) {
		this.totalMoney = totalMoney;
	}

	@ExcelField(title="数量", align=2, sort=3)
	public Integer getGoodsNum() {
		return goodsNum;
	}

	public void setGoodsNum(Integer goodsNum) {
		this.goodsNum = goodsNum;
	}

	

	@Length(min=0, max=30, message="商品号长度必须介于 0 和 30 之间")
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	@ExcelField(title="商品名称", align=2, sort=1)
	@Length(min=1, max=100, message="商品名称长度必须介于 1 和 100 之间")
	public String getCnName() {
		return cnName;
	}

	public void setCnName(String cnName) {
		this.cnName = cnName;
	}
	
	@Length(min=0, max=100, message="商品英文名长度必须介于 0 和 100 之间")
	public String getEnName() {
		return enName;
	}

	public void setEnName(String enName) {
		this.enName = enName;
	}
	
	@Length(min=1, max=50, message="所属门店号长度必须介于 1 和 50 之间")
	public String getStoreCode() {
		return storeCode;
	}

	public void setStoreCode(String storeCode) {
		this.storeCode = storeCode;
	}
	
	public Integer getGoodstypeId() {
		return goodstypeId;
	}

	public void setGoodstypeId(Integer goodstypeId) {
		this.goodstypeId = goodstypeId;
	}
	
	public Integer getVenderId() {
		return venderId;
	}

	public void setVenderId(Integer venderId) {
		this.venderId = venderId;
	}
	
	@NotNull(message="保底价格不能为空")
	public Double getMinPrice() {
		return minPrice;
	}

	public void setMinPrice(Double minPrice) {
		this.minPrice = minPrice;
	}
	
	@NotNull(message="价格不能为空")
	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}
	
	@NotNull(message="会员价不能为空")
	public Double getMemberPrice() {
		return memberPrice;
	}

	public void setMemberPrice(Double memberPrice) {
		this.memberPrice = memberPrice;
	}
	
	public Integer getClassesId() {
		return classesId;
	}

	public void setClassesId(Integer classesId) {
		this.classesId = classesId;
	}
	
	@Length(min=0, max=500, message="商品图片，多个图片用分号分隔长度必须介于 0 和 500 之间")
	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	@Length(min=0, max=255, message="默认物料描述，可修改长度必须介于 0 和 255 之间")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}
	
	@Length(min=0, max=500, message="商品详情长度必须介于 0 和 500 之间")
	public String getDetail() {
		return detail;
	}

	public void setDetail(String detail) {
		this.detail = detail;
	}
	
	@Length(min=0, max=500, message="售后服务长度必须介于 0 和 500 之间")
	public String getService() {
		return service;
	}

	public void setService(String service) {
		this.service = service;
	}
	
	public String getExamineStatus() {
		return examineStatus;
	}

	public void setExamineStatus(String examineStatus) {
		this.examineStatus = examineStatus;
	}
	
	public String getExamineInfo() {
		return examineInfo;
	}

	public void setExamineInfo(String examineInfo) {
		this.examineInfo = examineInfo;
	}

	public String getMaterielCode() {
		return materielCode;
	}

	public void setMaterielCode(String materielCode) {
		this.materielCode = materielCode;
	}

	public String getMaterielCnName() {
		return materielCnName;
	}

	public void setMaterielCnName(String materielCnName) {
		this.materielCnName = materielCnName;
	}
	
	@ExcelField(title="编号", align=2, sort=2)
	public String getPartsCode() {
		return partsCode;
	}

	public void setPartsCode(String partsCode) {
		this.partsCode = partsCode;
	}

	public String getVenderName() {
		return venderName;
	}

	public void setVenderName(String venderName) {
		this.venderName = venderName;
	}

	public Date getUpDate() {
		return upDate;
	}

	public void setUpDate(Date upDate) {
		this.upDate = upDate;
	}

	public Date getStarUpDate() {
		return starUpDate;
	}

	public void setStarUpDate(Date starUpDate) {
		this.starUpDate = starUpDate;
	}

	public Date getEndUpDate() {
		return endUpDate;
	}

	public void setEndUpDate(Date endUpDate) {
		this.endUpDate = endUpDate;
	}

	public Integer getQueryStatus() {
		return queryStatus;
	}

	public void setQueryStatus(Integer queryStatus) {
		this.queryStatus = queryStatus;
	}

	public String getQueryPartsCode() {
		return queryPartsCode;
	}

	public void setQueryPartsCode(String queryPartsCode) {
		this.queryPartsCode = queryPartsCode;
	}

	public String getQueryMaterielCode() {
		return queryMaterielCode;
	}

	public void setQueryMaterielCode(String queryMaterielCode) {
		this.queryMaterielCode = queryMaterielCode;
	}

	public String getQueryCnName() {
		return queryCnName;
	}

	public void setQueryCnName(String queryCnName) {
		this.queryCnName = queryCnName;
	}

	public String getQueryVenderName() {
		return queryVenderName;
	}

	public void setQueryVenderName(String queryVenderName) {
		this.queryVenderName = queryVenderName;
	}

	public Integer getQueryExamineStatus() {
		return queryExamineStatus;
	}

	public void setQueryExamineStatus(Integer queryExamineStatus) {
		this.queryExamineStatus = queryExamineStatus;
	}

	public Integer getQuerySource() {
		return querySource;
	}

	public void setQuerySource(Integer querySource) {
		this.querySource = querySource;
	}

	public String getQueryStoreCode() {
		return queryStoreCode;
	}

	public void setQueryStoreCode(String queryStoreCode) {
		this.queryStoreCode = queryStoreCode;
	}

	public String getStoreCnName() {
		return storeCnName;
	}

	public void setStoreCnName(String storeCnName) {
		this.storeCnName = storeCnName;
	}

	public Integer getStoreGoodsStock() {
		return storeGoodsStock;
	}

	public void setStoreGoodsStock(Integer storeGoodsStock) {
		this.storeGoodsStock = storeGoodsStock;
	}

	public Integer getStoreGoodsSellNum() {
		return storeGoodsSellNum;
	}

	public void setStoreGoodsSellNum(Integer storeGoodsSellNum) {
		this.storeGoodsSellNum = storeGoodsSellNum;
	}

	public Date getStoreGoodsUpdateDate() {
		return storeGoodsUpdateDate;
	}

	public void setStoreGoodsUpdateDate(Date storeGoodsUpdateDate) {
		this.storeGoodsUpdateDate = storeGoodsUpdateDate;
	}

	public Integer getQueryVenderId() {
		return queryVenderId;
	}

	public void setQueryVenderId(Integer queryVenderId) {
		this.queryVenderId = queryVenderId;
	}

	public Integer getClassessOnceId() {
		return classessOnceId;
	}

	public void setClassessOnceId(Integer classessOnceId) {
		this.classessOnceId = classessOnceId;
	}

	public Integer getClassessTwiceId() {
		return classessTwiceId;
	}

	public void setClassessTwiceId(Integer classessTwiceId) {
		this.classessTwiceId = classessTwiceId;
	}

	public Integer getClassessThirdId() {
		return classessThirdId;
	}

	public void setClassessThirdId(Integer classessThirdId) {
		this.classessThirdId = classessThirdId;
	}

	public String getDeleteImage() {
		return deleteImage;
	}

	public void setDeleteImage(String deleteImage) {
		this.deleteImage = deleteImage;
	}

	public String getDeleteDetail() {
		return deleteDetail;
	}

	public void setDeleteDetail(String deleteDetail) {
		this.deleteDetail = deleteDetail;
	}

	public String getDeleteService() {
		return deleteService;
	}

	public void setDeleteService(String deleteService) {
		this.deleteService = deleteService;
	}

	public String getPartCode() {
		return partCode;
	}

	public void setPartCode(String partCode) {
		this.partCode = partCode;
	}

	public List<String> getCarList() {
		return carList;
	}

	public void setCarList(List<String> carList) {
		this.carList = carList;
	}

	public String getStoreType() {
		return storeType;
	}

	public void setStoreType(String storeType) {
		this.storeType = storeType;
	}

	public String getGoodsCode() {
		return goodsCode;
	}

	public void setGoodsCode(String goodsCode) {
		this.goodsCode = goodsCode;
	}

	public String getStoreName() {
		return storeName;
	}

	public void setStoreName(String storeName) {
		this.storeName = storeName;
	}

	public Integer getStoreStock() {
		return storeStock;
	}

	public void setStoreStock(Integer storeStock) {
		this.storeStock = storeStock;
	}

	public BigDecimal getVipPrice() {
		return vipPrice;
	}

	public void setVipPrice(BigDecimal vipPrice) {
		this.vipPrice = vipPrice;
	}

	public String getAreaName() {
		return areaName;
	}

	public void setAreaName(String areaName) {
		this.areaName = areaName;
	}
	
	public List<String> getImgList() {
		if(StringUtils.isNotBlank(image)) {
			String []im=image.split(";");
			return Arrays.asList(im);
		}else {
			return new ArrayList<>();
		}
		
	}

	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	
	public List<String> getDetailImgList() {
		if(StringUtils.isNotBlank(detail)) {
			String []im=detail.split(";");
			return Arrays.asList(im);
		}else {
			return new ArrayList<>();
		}
	}

	public List<String> getServiceImgList() {
		if(StringUtils.isNotBlank(service)) {
			String []im=service.split(";");
			return Arrays.asList(im);
		}else {
			return new ArrayList<>();
		}
	}

	public String getVideoUrl() {
		return videoUrl;
	}

	public void setVideoUrl(String videoUrl) {
		this.videoUrl = videoUrl;
	}

	public String getGoodsIntroduce() {
		return goodsIntroduce;
	}

	public void setGoodsIntroduce(String goodsIntroduce) {
		this.goodsIntroduce = goodsIntroduce;
	}

}